package com.saasitems.front.web.controller;

import com.saasitems.admin.model.Original;
import com.saasitems.admin.web.vo.original.OriginalQueryVO;
import com.saasitems.common.model.PageInfo;
import com.saasitems.common.utils.ConstantUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by apple on 17/4/23.
 */
@Controller
public class FrontController {

    @RequestMapping(value="front/home/{classId}",method= RequestMethod.GET)
    public ModelAndView index(@PathVariable("classId") String classId, HttpServletRequest request) {
        Map<String, Object> model = new HashMap<String, Object>();
        model.put("classId", classId);
        return new ModelAndView("front/home", model);
    }

    @RequestMapping(value="front/songdu/{classId}/{originalId}",method= RequestMethod.GET)
    public ModelAndView songdu(@PathVariable("classId") String classId, @PathVariable("originalId") String originalId, HttpServletRequest request) {
        Map<String, Object> model = new HashMap<String, Object>();
        model.put("classId", classId);
        model.put("originalId", originalId);
        return new ModelAndView("front/songdu", model);
    }

    @RequestMapping(value="front/tianzi/{classId}/{originalId}",method= RequestMethod.GET)
    public ModelAndView tianzi(@PathVariable("classId") String classId, @PathVariable("originalId") String originalId, HttpServletRequest request) {
        Map<String, Object> model = new HashMap<String, Object>();
        model.put("classId", classId);
        model.put("originalId", originalId);
        return new ModelAndView("front/tianzi", model);
    }

    @RequestMapping(value="front/middle/{classId}/{originalId}",method= RequestMethod.GET)
    public ModelAndView middle(@PathVariable("classId") String classId, @PathVariable("originalId") String originalId, HttpServletRequest request) {
        Map<String, Object> model = new HashMap<String, Object>();
        model.put("classId", classId);
        model.put("originalId", originalId);
        return new ModelAndView("front/middle", model);
    }


}
